class code1 {
    //宝石与石头
    public int numJewelsInStones(String s1, String s2) {
        //把s1加入hash
        int[] hash = new int[58];
        int ret = 0;

        for(int i=0;i<s1.length();i++) {
            int ch = s1.charAt(i) - 'A';
            if(hash[ch] == 0) {
                hash[ch] = 1;
            }
        }

        //遍历s2
        for(int i=0;i<s2.length();i++) {
            int ch = s2.charAt(i)-'A';
            if(hash[ch] == 1) {
                ret++;
            }
        }

        return ret;
    }
}